package com.hethongviet.job.pages;

import com.hethongviet.job.AppMain;
import com.hethongviet.job.R;
import com.hethongviet.job.helpers.database.LoginInfoSQLite;

import android.app.Activity;
import android.os.Bundle;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;

public class UserSettingActivity extends Activity
{
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.page_user_setting);

		final CheckBox checkBoxScaleImage = (CheckBox) findViewById(R.id.checkboxSettingNetworkImage);

		checkBoxScaleImage.setChecked(AppMain._user.isSettingScaleImage());

		checkBoxScaleImage.setOnCheckedChangeListener(new OnCheckedChangeListener() {

			public void onCheckedChanged(CompoundButton buttonView,
					boolean isChecked)
			{
				AppMain._user.setSettingScaleImage(isChecked);
				LoginInfoSQLite loginInfoSQLite = new LoginInfoSQLite(UserSettingActivity.this);
				loginInfoSQLite.updateSetting(AppMain._user);
			}
		});
	}
}
